package com.sright.bcard.enterprise.dal.mapper;

import com.sright.bcard.common.service.share.base.dao.BaseMapper;
import com.sright.bcard.common.service.share.dto.page.BetweenDateParamRequest;
import com.sright.bcard.common.service.share.dto.page.PageParamRequest;
import com.sright.bcard.enterprise.dal.entity.EnterpriseDO;
import com.sright.bcard.enterprise.dal.entity.ext.EnterpriseExtraDO;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface EnterpriseDOMapper extends BaseMapper<EnterpriseDO> {
    int deleteByPrimaryKey(@Param("id") Integer id);

    EnterpriseDO selectByMobile(@Param("mobile") String mobile);

    List<EnterpriseDO> selectByEnterpriseIdList(List<Long> enterpriseIdList);

    Integer countOfEnterpriseExtra(@Param("keyword") String keyword, @Param("status") Integer status,
                                   @Param("between") BetweenDateParamRequest betweenDateParamRequest, @Param("currentDate") Date currentDate);

    List<EnterpriseExtraDO> selectPageOfEnterpriseExtra(@Param("keyword") String keyword,
                                                        @Param("status") Integer status,
                                                        @Param("between") BetweenDateParamRequest betweenDateParamRequest,
                                                        @Param("page") PageParamRequest pageParamRequest, @Param("currentDate") Date currentDate);

    List<EnterpriseDO> selectEnterpriseList();

    List<EnterpriseDO> selectExpireListByDate(@Param("beginDate") Date beginDate, @Param("endDate") Date endDate);

    Integer onStatus(EnterpriseDO enterpriseDO);

    List<EnterpriseDO> selectExpireListByCreateDate(@Param("beginDate") Date beginDate, @Param("endDate") Date endDate);
}